From 85c5f6058a01805d63a498b5f28d6a9daab3f7e1 Mon Sep 17 00:00:00 2001 From: William Hua Date: Tue, 3 Feb 2015 16:23:14 +0100 Subject: [PATCH] mir: don't always request mir surfaces Some child window behaviour is faked by painting in the parent, so we don't bother creating the Mir surface in that case. --- gdk/mir/gdkmirwindowimpl.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c index 5ecec56ba3..80b6e5667e 100644 --- a/gdk/mir/gdkmirwindowimpl.c +++ b/gdk/mir/gdkmirwindowimpl.c @@ -199,6 +199,15 @@ create_mir_surface (GdkDisplay *display, return surface; } +/* TODO: Remove once we have proper transient window support. */ +static gboolean +should_render_in_parent (GdkWindow *window) +{ + GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl); + + return impl->transient_for && gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL; +} + static void ensure_surface_full (GdkWindow *window, MirBufferUsage buffer_usage) @@ -207,7 +216,7 @@ ensure_surface_full (GdkWindow *window, MirEventDelegate event_delegate = { event_cb, NULL }; GdkMirWindowReference *window_ref; - if (impl->surface) + if (impl->surface || should_render_in_parent (window)) return; /* no destroy notify -- we must leak for now @@ -289,15 +298,6 @@ redraw_transient (GdkWindow *window) gdk_window_invalidate_rect (GDK_MIR_WINDOW_IMPL (window->impl)->transient_for, &r, FALSE); } -/* TODO: Remove once we have proper transient window support. */ -static gboolean -should_render_in_parent (GdkWindow *window) -{ - GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl); - - return impl->transient_for && gdk_window_get_window_type (window) != GDK_WINDOW_TOPLEVEL; -} - static void send_buffer (GdkWindow *window) { -- 2.30.2